|
|
 |
|
|
|
|
133:
134: 'Create role objects based on number
135: 'of records returned. For now, we'll
136: 'just mock up the roles
137: arrRoles = Array(Worker, Manager)
138: AllRoles.Add CStr(arrRoles(eRole.WorkerRole - 1)),
CStr(eRole.WorkerRole)
139: AllRoles.Add CStr(arrRoles(eRole.ManagerRole - 1)),
CStr(eRole.ManagerRole)
140:
141: 'Set current role to the first role
142: Set CurrRole = AllRoles.Item(eRole.WorkerRole)
143: MsgBox CurrRole.RoleID
144: End Sub
145: 'In the collection, AllRoles
146: 'Add the roles the user performs
147: Public Sub Add(RoleID As String, _
148: Optional sKey As String) 'As Role
149: 'Public Sub Add(Key As String, _
150: RoleID As String, Optional sKey As String) 'As Role 'create a new object
151:
152: Dim objNewMember As Role
153:
154: 'Determine which object is being created
155: Select Case RoleID
156: Case Worker
157: Set objNewMember = New WorkerRole
158: Case Manager
159: Set objNewMember = New ManagerRole
160: End Select
161:
162: 'set the properties passed into the method
163: 'objNewMember.Key = Key
164: 'If IsObject(AllForms) Then
165: ' Set objNewMember.AllForms = AllForms
166: 'Else
167: ' objNewMember.AllForms = AllForms
168: 'End If
169: objNewMember.RoleID = RoleID
170: If Len(sKey) = 0 Then
171: mCol.Add objNewMember
172: Else
173: mCol.Add objNewMember, sKey
174: End If
175:
176: ''return the object created
177: 'Set Add = objNewMember
|
|
|
|
|
|